<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<title>会员列表</title>
		<link rel="stylesheet" href="__AGENT__/css/iconfont.css" />
		<link rel="stylesheet" href="__AGENT__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right"><!--右侧内容-->
					<div class="rigtop">
						<span class="title">扫码会员</span>
					</div>
					<div class="indrig_con">
						<div class="zizh_conbox" style="padding-top: 20px;">
							<!--选项卡内容开始-->
							<form id="my_form" action="{:url('agent/accounts/scancode_user')}" method="post">
								<div class="zizh_con_1">
									<div class="shxx_row chax_row clearfix">
							            <div class="left">加入时间：</div>
							            <div class="right clearfix">
							                <div class="right clearfix">
									            <div class="layui-inline">
												    <div class="layui-input-inline">
												       <input type="text" class="layui-input" name="begin_time" id="begin_time" placeholder="yyyy年MM月dd日">
												    </div>
												</div>
									                <i class="chax_line"></i>
									            <div class="layui-inline">
												    <div class="layui-input-inline">
												    <input type="text" class="layui-input" name="end_time"  id="end_time" placeholder="yyyy年MM月dd日">
												    </div>
												</div>
									        </div>
							            </div>
								    </div>
								 
								</div>
								<div class="chax_rowbox clearfix spfl_topbox">
										<input type="hidden" name="pingci" id="pingci"/>
										<div id="div_pingci" class="shxx_row clearfix">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
								            <span class="level_flbt">消费频次：</span>
											<span class="level_fl {if $pingci==0}active{/if}" data-id=0>全部</span>
											{foreach name="list1" item="l"}
											 <span  class="level_fl {if $pingci eq $l.id}active{/if}" data-id='{$l.id}'>{$l.name}</span>
											{/foreach}
											
								        </div>
								</div>
								<div class="chax_rowbox clearfix spfl_topbox">
									<input type="hidden" name="nengli" id="nengli"/>
								        <div id="div_nengli" class="shxx_row clearfix">
								            <span class="level_flbt">消费能力：</span>
											<span class="level_fl {if $nengli==0}active{/if}" data-id=0>全部</span>
											{foreach name="list2" item="l2"}
											 <span class="level_fl {if $nengli eq $l2.id}active{/if} " data-id='{$l2.id}'>{$l2.name}</span>
											{/foreach}
								        </div>
								        <div class="shxx_row clearfix">
										    <button type="submit"  class="htcxbtn">搜索</button>
										</div>
								</div>
							</form>
								<div class="chax_conbox">
									<div class="chax_jiegbt clearfix">
										<div class="chax_jieg">会员总计：{$list->total();}个</div>
										<div class="chax_xzbtnbox">
											<a href="#" onclick="check()"><i class="iconfont icon-daochu"></i>导出</a>
										</div>

									</div>
									<div class="chax_jiegnr">
										<table class="zizh_table1">
											<thead>
												<tr>
													<th style="width: 50px;">ID</th>
													<th>会员名</th>
													<th>手机号</th>
													<th style="width: 80px;">消费次数</th>
													<th style="width: 100px;">消费金额</th>
													<th style="width: 80px;">性别</th>
													<th style="width: 200px;">注册时间</th>
												</tr>
											</thead>
											<tbody id="tbody">
												{volist name="list" id="vo" empty="$empty"}
												<tr>
													<td>{$vo.id}</td>
													<td>
														{if count($vo.user_name)>0}
															{$vo.user_name}
														{else}
															支付会员
														{/if}
													</td>
													<td>{$vo.mobile}</td>
													<td>{$vo.total_num}</td>
													<td>{$vo.total_money}</td>
													<td>{$vo.sex}</td>
													<td>{$vo.add_time}</td>
												</tr>
												{/volist}
											</tbody>
										</table>
										<div class="fenye" style="display: block;">
											{$list->render()}
										</div>
									</div>
								</div>
							</div>
						</div>

					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
		
	</body>

</html>
<script>
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		
	})
	$("#div_pingci .level_fl").click(function(){
		$("#div_pingci .level_fl").removeClass("active");
		$(this).addClass("active");
		$("#pingci").val($(this).data("id"));
	})	
	$("#div_nengli .level_fl").click(function(){
		$("#div_nengli .level_fl").removeClass("active");
		$(this).addClass("active");
		$("#nengli").val($(this).data("id"));
	})
	
	//导出
	function check() {
		var begin_time = $('#begin_time').val();
		var end_time = $('#end_time').val();		
		var mobile = $('#mobile').val();
		window.location.href = "/agent/accounts/scancode_dc.html?begin_time=" + begin_time + "&end_time=" + end_time+ "&mobile=" + mobile;
	}
</script>